home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 07 - 1991 / 07.11 Nov 91 / Jorg Sources / MacTutor7App.h < prev    next >
Encoding:
Text File  |  1991-09-23  |  1.6 KB  |  62 lines  |  [TEXT/MPS ]

  1. // Constants, resource definitions, etc.
  2.  
  3. #define kErrStrings     129
  4.  
  5. /* The following are indicies into STR# resources. */
  6. #define    eNoMemory                1
  7. #define    eNoWindow                2
  8.  
  9. #define kMinSize                48 // min heap needed in K
  10.  
  11. #define    rMenuBar    128                /* application's menu bar */
  12. #define    rAboutAlert    128                /* about alert */
  13. #define    rDocWindow    128                /* application's window */
  14.  
  15. #define    mApple                    128        /* Apple menu */
  16. #define    iAbout                    1
  17.  
  18. #define    mFile                    129        /* File menu */
  19. #define    iNew                    1
  20. #define    iClose                    4
  21. #define    iQuit                    12
  22.  
  23. #define    mEdit                    130        /* Edit menu */
  24. #define    iUndo                    1
  25. #define    iCut                    3
  26. #define    iCopy                    4
  27. #define    iPaste                    5
  28. #define    iClear                    6
  29.  
  30. #define    myMenu                    131        /* Sample menu */
  31. #define    item1                    1
  32. #define    item2                    2
  33. #define    item3                    3
  34. #define    item5                    5
  35.  
  36. class TMacTutorApp : public TApplication {
  37. public:
  38.     TMacTutorApp(void);            // Our constructor
  39.     void EventLoop(void);    
  40.         // overridden event loop for high level event support
  41.  
  42.         // handle the four required apple events
  43.     void DoOpen(void);
  44.     void DoNew(void);
  45.     void DoPrint(void);
  46.     void Terminate(void);
  47.     void DoHighLevelEvent(void);
  48.  
  49. private:
  50.     // routines from TApplication we are overriding
  51.     long HeapNeeded(void);
  52.     unsigned long SleepVal(void);
  53.     void AdjustMenus(void);
  54.     void DoMenuCommand(short menuID, short menuItem);
  55. };
  56.  
  57. // kMaxOpenDocuments is used to determine whether a new document can be opened
  58. // or created. We keep track of the number of open documents, and disable the
  59. // menu items that create a new document when the maximum is reached. If the
  60. // number of documents falls below the maximum, the items are enabled again. */
  61. const short    kMaxOpenDocuments = 4;
  62.